<style>
.rt_content{background-color: #FFF;padding: 20px;}
</style>
<div class="page_title">
    <h2 class="fl">{$pageTitle}</h2>
</div>
<section>
    <ul class="ulColumn2">
        <input type="hidden" name="config_id" value="{:encrypt_id($config.config_id)}" />
        <li>
            <span class="item_name" style="width:180px;">七牛账号授权accesskey：</span>
            <input name="qiniu_accessKey" type="text" class="textbox textbox_295" value="{$config.value.qiniu_accessKey}" maxlength="200" placeholder="" />
            <div class="tishi"><i class="iconfont iconfont-tishi"></i>请填写七牛账号的授权信息</div>
        </li>
        <li>
            <span class="item_name" style="width:180px;">七牛账号授权secretkey：</span>
            <input name="qiniu_secretKey" type="text" class="textbox textbox_295" value="{$config.value.qiniu_secretKey}" maxlength="200" placeholder="" />
            <div class="tishi"><i class="iconfont iconfont-tishi"></i>请填写七牛账号的授权信息</div>
        </li>
        <li>
            <span class="item_name" style="width:180px;">直播空间：</span>
            <input name="hub_name" type="text" class="textbox textbox_295" value="{$config.value.hub_name}" maxlength="50" placeholder="" />
            <div class="tishi"><i class="iconfont iconfont-tishi"></i>该空间必须在所配置的账号中已创建</div>
        </li>
        <li>
            <span class="item_name" style="width:180px;">直播切片地址：</span>
            <input name="hub_ts_url" type="text" class="textbox textbox_295" value="{$config.value.hub_ts_url}" maxlength="200" placeholder="" />
            <div class="tishi"><i class="iconfont iconfont-tishi"></i>请确保该地址已正常解析</div>
        </li>
        <li>
            <span class="item_name" style="width:180px;">直播数据处理队列：</span>
            <input name="pipeline" type="text" class="textbox textbox_295" value="{$config.value.pipeline}" maxlength="50" placeholder="" />
            <div class="tishi"><i class="iconfont iconfont-tishi"></i>该队列必须已经创建</div>
        </li>
        <li>
            <span class="item_name" style="width:180px;"></span>
            <input type="submit" id="submit" class="link_btn" value="保存"/>
        </li>
    </ul>
</section>
<script>
$(function(){
    $("#submit").click(function(){
        var send_data = {
              url:U('admin/Stream/stream_service'),
              type:'POST',
              data:{
                  config_id:'{:encrypt_id($config.config_id)}',
                  qiniu_accessKey:$("input[name='qiniu_accessKey']").val(),
                  qiniu_secretKey:$("input[name='qiniu_secretKey']").val(),
                  hub_name:$("input[name='hub_name']").val(),
                  hub_ts_url:$("input[name='hub_ts_url']").val(),
                  pipeline:$("input[name='pipeline']").val(),
              }
        };
        send_ajax(send_data,function(res){
            if(res.status == 1){
                msg_success(res.data.info,'',1800);
            }else{
                msg_error(res.message);
            }
        })
    })
});
</script>